cmake_minimum_required(VERSION 3.5)

# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
# add_compile_options(-fPIC -Wall -Wno-error -O2 -g)
# add_compile_options(-Wno-unused-variable
#     -Wno-unused-but-set-variable
#     -Wno-unused-function
#     -Wno-misleading-indentation
#     -Wno-unused-label
#     -Wno-format-truncation
#     -Wall
#     -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare
#     )

PROJECT(lvgl_app)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/lvgl
    ${CMAKE_CURRENT_SOURCE_DIR}/lvgl/src/font
    ${CMAKE_CURRENT_SOURCE_DIR}/lvgl/src
    ${CMAKE_CURRENT_SOURCE_DIR}/lv_drivers/
    ${CMAKE_CURRENT_SOURCE_DIR}/lv_app/
    ${CMAKE_CURRENT_SOURCE_DIR}/lv_app/src
    ${CMAKE_CURRENT_SOURCE_DIR}/lv_port/
    )

set(CXX_SRCS
    ${CMAKE_CURRENT_SOURCE_DIR}/lvgl_app.c
    ${CMAKE_CURRENT_SOURCE_DIR}/lv_app/src/ui.c
    )

add_subdirectory(lvgl)
add_subdirectory(lv_drivers)

# set(LV_LVGL_H_INCLUDE_SIMPLE ON)

# ADD_EXECUTABLE(${PROJECT_NAME}  ${CUSTOM_SOURCES} ${GENERATED_SOURCES} ${CXX_SRCS})
add_library(${PROJECT_NAME} STATIC ${CXX_SRCS})
target_link_libraries(${PROJECT_NAME}
    PRIVATE lvgl::lvgl
    PRIVATE lvgl::drivers
    drm
    pthread)

